﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace WindowsFormsApplication1
{
    public partial class ProductInventory : Form
    {
        public ProductInventory()
        {
            InitializeComponent();
        }

        private void productBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.productBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.seniordesignDataSet);

        }

        private void ProductInventory_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'seniordesignDataSet.product' table. You can move, or remove it, as needed.
            this.productTableAdapter.Fill(this.seniordesignDataSet.product);

        }

       
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int chart_type = this.comboBoxChartType.SelectedIndex;
            chart_type += 1;
            switch (chart_type)
            {
                case 1:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Bar;break;
                case 2:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Column;break;
                case 3:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Line;break;
                case 4:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Pie;break;
                case 5:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Point;break;
                case 6:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Pyramid;break;
                case 7:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Radar;break;
                case 8:
                    productInventoryChart.Series[0].ChartType = SeriesChartType.Renko;break;
                
    
            }       
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBoxShowValue.Checked)
            {
                productInventoryChart.Series[0].IsValueShownAsLabel = true;
            }
            else
            {
                productInventoryChart.Series[0].IsValueShownAsLabel = false;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ProductInventoryReport productinventoryreport = new ProductInventoryReport();
            productinventoryreport.MdiParent = Admin_Form.ActiveForm;
            productinventoryreport.Show();

        }
    }
}
